package com.hemaapp.yjnh.nettask;

import com.google.gson.Gson;
import com.hemaapp.hm_FrameWork.result.HemaArrayResult;
import com.hemaapp.yjnh.BaseHttpInformation;
import com.hemaapp.yjnh.BaseNetTask;
import com.hemaapp.yjnh.bean.BlogType;

import org.json.JSONObject;

import java.util.HashMap;

import xtom.frame.exception.DataParseException;

public class BlogTypeListTask extends BaseNetTask {

	public BlogTypeListTask(BaseHttpInformation information,
							HashMap<String, String> params) {
		super(information, params);
	}

	@Override
	public Object parse(JSONObject jsonObject) throws DataParseException {
		return new Result(jsonObject);
	}
	
	private class Result extends HemaArrayResult<BlogType>{

		public Result(JSONObject jsonObject) throws DataParseException {
			super(jsonObject);
			// TODO Auto-generated constructor stub
		}

		@Override
		public BlogType parse(JSONObject jsonObject) throws DataParseException {
			return new Gson().fromJson(jsonObject.toString(), BlogType.class);
		}
		
	}

}
